package uc;

import co.chuangdian.oflauncher.R;
import android.annotation.SuppressLint;
import android.content.Context;
import android.graphics.Bitmap;
import android.util.AttributeSet;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.ImageView;

@SuppressLint("Recycle")
public class BlurImageView extends FrameLayout {

	ImageView imageView, blurImageView;

	public BlurImageView(Context context) {
		super(context);
		init();
	}

	public BlurImageView(Context context, AttributeSet attrs) {
		super(context, attrs);
		init();
	}

	public void setBlur(float percent) {
		blurImageView.setAlpha(percent);
	}

	void init() {
		View.inflate(getContext(), R.layout.uc_blurimageview, this);
		imageView = (ImageView) this.findViewById(R.id.imageView);
		blurImageView = (ImageView) this.findViewById(R.id.blurImageView);
	}

	public void setImage(Bitmap image) {
		imageView.setImageBitmap(image);
	}

	public void setBlurImage(Bitmap image) {
		blurImageView.setImageBitmap(image);
	}
}
